<template>
    <div class="nav-bar">
        <nav>
            <p class="title"><span @click="goback">&lt;</span>{{title}}</p>
        </nav>
    </div>
</template>
<script>
export default {
  name: 'nav-bar',
  props: ['title'],
  methods: {
    goback () {
      this.$router.go(-1)
    }
  }
}
</script>
<style lang="less">
.nav-bar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    margin-top: 2.5rem;
    z-index: 2;
  nav {
    font-size: 20px;
    text-align: center;
    background-color: #ddd;
  }
  span:first-child {
    position: absolute;
    left: 1rem;
    cursor: pointer;
  }
}
</style>
